﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace MoControls
{
    public class XNADefaultRenderer
        : XNARendererBase
    {
        #region Fields
        
        #endregion

        #region Properties        

        #endregion

        #region .ctor

        public XNADefaultRenderer(XNAUIManager manager)
            : base(manager)
        {
        }

        #endregion

        #region Methods

        #region Drawing Primitives

        public override void Draw(Texture2D texture, Rectangle destination, Color color)
        {
            if (destination.Width > 0 && destination.Height > 0)
                this.spriteBatch.Draw(texture, destination, null, color, 0.0f, Vector2.Zero, SpriteEffects.None, this.Manager.DefaultLayerDepth);
        }

        public override void Draw(Texture2D texture, Rectangle destination, Rectangle source, Color color)
        {
            if (source.Width > 0 && source.Height > 0 && destination.Width > 0 && destination.Height > 0)
                this.spriteBatch.Draw(texture, destination, source, color, 0.0f, Vector2.Zero, SpriteEffects.None, this.Manager.DefaultLayerDepth);
        }

        public override void Draw(Texture2D texture, int left, int top, Color color)
        {
            this.spriteBatch.Draw(texture, new Vector2(left, top), null, color, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, this.Manager.DefaultLayerDepth);
        }

        public override void Draw(Texture2D texture, int left, int top, Rectangle source, Color color)
        {
            if (source.Width > 0 && source.Height > 0)
                this.spriteBatch.Draw(texture, new Vector2(left, top), source, color, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, Manager.DefaultLayerDepth);
        }

        #endregion

        #endregion
    }
}
